﻿using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Data;
using System.Text;

namespace Christ3D.Infrastruct.UoW
{
    public sealed class DbSession : IDisposable
    {
        public IDbConnection Connection { get; }
        public IDbTransaction Transaction { get; set; }

        public DbSession(DbConnection connection)
        {
            Connection = connection;
            Connection.Open();
        }

        public void Dispose() => Connection?.Dispose();
    }
}
